<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<%@ page import="com.onlineMIS.common.Common_util"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>千禧宝贝连锁店管理信息系统</title>
<%@ include file="../../common/Style.jsp"%>

<script>
$(document).ready(function(){	
	parent.$.messager.progress('close'); 
});

function cancelExpense(id){
	$.messager.confirm('确认','您确认想要红冲此条记录吗？',function(r){
	    if (r){	   
	        var params = "formBean.expenseHq.id=" +id;
		    $.post("<%=request.getContextPath()%>/action/financeHQJSON!cancelExpense",params, cancelExpenseBK,"json");	
	    }
	});
}

function cancelExpenseBK(data){
	
	var returnCode = data.returnCode;
	if(returnCode == SUCCESS){
        $.messager.alert('操作成功',data.message,
        		setTimeout("goBack("+data.returnValue+")",2000)
    	);

    } else 
       $.messager.alert('操作失败', data.message, 'error');					
}

function goBack(id){
	window.location.href = "action/financeHQJSP!editExpense?formBean.expenseHq.id=" + id;
}

</script>
</head>
<body>
   <s:form action="" method="POST"  name="expenseForm" id="expenseForm" theme="simple"> 
	<table width="95%" align="center"  class="OuterTable" >
	    <tr><td>
	     <s:hidden name="formBean.expenseHq.id"></s:hidden>
		 <table width="100%" border="0">
		    
	        	<tr class="PBAOuterTableTitale">
	        			
		       			<td height="50" width="10%" colspan="8"><s:property value="formBean.expenseHq.typeHQS"/> 单据编号:&nbsp<s:property value="formBean.expenseHq.id"/> &nbsp &nbsp &nbsp &nbsp &nbsp 单据状态：

		       			<s:if test="formBean.expenseHq.status == 3">
												<font style="color: red"><s:property value="formBean.expenseHq.statusS"/>
												</font>
												</s:if><s:else><s:property value="formBean.expenseHq.statusS"/></s:else></td>
	       		 </tr>	        

			<tr height="10"></tr>
	        <tr class="InnerTableContent">
				<td width="5%" align="center"><strong>单据日期 :</strong></td>
				<td width="10%" align="center"><strong><s:property value="formBean.expenseHq.expenseDate"/></strong></td>						
				<td width="10%"align="center"><strong>支出账目 :</strong></td>
				<td width="10%"><strong><s:property value="formBean.expenseHq.financeCategory.itemName"/></strong></td>	
				<td width="10%"align="center"><strong>创建人 :</strong></td>
				<td width="10%"><strong><s:property value="formBean.expenseHq.user.user_name"/></strong></td>	
				<td width="10%"align="center"><strong>最后修改时间 :</strong></td>
				<td width="10%"><strong><s:property value="formBean.expenseHq.lastUpdateDate"/></strong></td>				

	
			</tr>
		    <tr class="InnerTableContent">

			</tr>


				<tr class="InnerTableContent">
							<td height="4" colspan="8"><hr width="100%" color="#FFCC00" /></td>
						</tr>
				<tr class="InnerTableContent">
						<td colspan="8">
						
						<table  align="left" class="OuterTable" border="0" width="100%" height="100px"
									id="org_table">
									<tr class="PBAInnerTableTitale" align='left'>
										<th width="10%" height="35" align="center">序号</th>
										<th width="15%" align="center">费用类型</th>
										<th width="15%" align="center">金额</th>
										<th width="40%" align="center">备注信息</th>
										
									</tr>
									<s:iterator value="formBean.expenseHq.list" status = "st" id="items" >
										<tr  class="InnerTableContent"
											<s:if test="#st.even">style="<%=Common_util.EVEN_ROW_BG_STYLE %>"</s:if>>
											<td align="center"><s:property value="#st.index +1"/></td>
											<td align="center"><s:property value="#items.expenseHqType.parentName" />:<s:property value="#items.expenseHqType.name" /></td>
											<td align="center"><s:property value="#items.amount" /></td>
											<td align="center"><s:property value="#items.comment" /></td>
											
										</tr>
									</s:iterator>
									<tr class="PBAInnerTableTitale">						
										<td width="10%" align="center"><strong>合计金额:</strong></td>
										<td></td>	
										<td align="center"><s:property value="formBean.expenseHq.amount" /></td>	
										<td></td>				
									</tr>																								
									</table>
								</td>									
					</tr>

				<tr class="InnerTableContent">						
					 <td width="10%" align="center"><strong>单据备注:</strong></td>
					<td  align="left" colspan="5"><s:property value="formBean.expenseHq.comment" /></td>
						
				</tr>

				<s:if test="formBean.canCancel">
					<tr class="InnerTableContent">
						<td></td>
						<td colspan="5">
							 <a id="btn2" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'" onclick="cancelExpense(<s:property value="formBean.expenseHq.id"/>);">红冲单据</a> 							
						</td>
					</tr>
				</s:if>
	 </table>
	 </td>
	 </tr>
	 </table>
	 </s:form>
   
</body>
</html>